<template>
    <div id="authModelEdit">
        <div class="functionalArea">
            <el-form class="formEmbedTable" :model="detailData">
                <table> 
                    <tr>
                        <td>Transaction Sequence No.</td>
                        <td>{{detailData.flowNo}}</td>
                                    
                    </tr>
                    <tr>
                        <td>Submit</td>
                        <td>{{detailData.userAlias}}</td>	
                    </tr>
                </table>
            </el-form>
        </div>
        <div class="functionalArea formEmbedTable">
            
            <el-form class="formEmbedTable" :model="bsnInfo">
                <table> 
                    <tr>	
                        <td>Function：</td>
                        <td > {{$tools.dict.imBsnName(bsnInfo.bsnCode)}} </td>	
                    </tr>
                     <tr id="needAuth"> 
                        <td>Function：</td>
                        <td > {{bsnInfo.needAuth==0 ? "Immediate Effect":"Mutual authorization"}} </td>	
                    </tr>
                    <tr id="authType"> 	
                        <td>Function：</td>
                        <td > {{bsnInfo.authType==1 ? "Counter Authorization":this.bsnInfo.authType==2 ? "Audits Authorization":""}} </td>	
                    </tr>
                </table>
                
            </el-form>
            
            <div class="mt20 btnArea tac">
                <el-button type="primary" @click="backMenu">Back</el-button>
            </div>
        </div>
    </div>
</template>
<script>
    import ghbIcon from '@src/components/icon';
    export default{
        name:'authModelEdit',
        components:{
            ghbIcon
        },
        props:[
            'detailData',
        ],
        mounted(){
            let bsnTemp=this.detailData.bsnImList[0]
            let newBsnTemp={}
            console.log("bsnTemp:"+JSON.stringify(bsnTemp))
            $.each(bsnTemp,function(i,n){
                if(i=="bsnCode"){
                    console.log(i+":"+n.value)
                    newBsnTemp[i]=n.value
                }
                if(i=="needAuth"){
                    newBsnTemp[i]=n.value
                }
                if(i=="authType"){
                    newBsnTemp[i]=n.value
                }
            })
            this.bsnInfo=newBsnTemp;
        },
        data(){
            return {
                bsnInfo:{bsnCode:'',needAuth:'',authType:''},
            }
        },
        methods:{
            backMenu(){
                 this.$emit("back")
            },
            
        },
        
    }

</script>